<template>
  <el-dialog :title="$t('letterReviewOrder.circulationRecord')" :visible.sync="showState" :before-close="closeSubmit" :close-on-click-modal="false">
    <el-row>
      <el-table
        v-loading="loading"
        :header-cell-style="{background:'#eef1f6',color:'#606266'}"
        :data="tableData"
        border
        :stripe="true"
        style="width: 100%"
      >
        <el-table-column
          prop="creditOrderNo"
          :label="$t('letterReviewOrder.reviewOrderNo')"
          min-width="180"
        />
        <el-table-column
          prop="currentStageName"
          :label="$t('letterReviewOrder.circulationStage')"
          min-width="150"
        />
        <el-table-column
          prop="currentStaffId"
          :label="$t('letterReviewOrder.distributionID')"
          min-width="150"
        />
        <el-table-column
          prop="currentStaffName"
          :label="$t('letterReviewOrder.distributionName')"
          min-width="150"
        />
        <el-table-column
          prop="operatorName"
          :label="$t('letterReviewOrder.operator')"
          min-width="150"
        />
        <el-table-column
          prop="createTime"
          :label="$t('letterReviewOrder.operatingTime')"
          min-width="170"
        />
      </el-table>
    </el-row>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="closeSubmit">{{ $t('common.operate.sure') }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getCreditOrderFlowHistory } from '@/api/risk'
export default {
  name: 'CirculationRecord',
  props: {
    showDialog: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      loading: true,
      tableData: []
    }
  },
  computed: {
    showState: {
      get: function() {
        return this.showDialog
      },
      set: function() {
      }
    }
  },
  methods: {
    getData(id) {
      getCreditOrderFlowHistory(id)
        .then(res => {
          this.loading = false
          if (res.success) {
            this.tableData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    },
    setDesc(data) {
      this.$emit('set-desc', data)
    },
    textDesc(data) {
      this.$emit('text-desc', data)
    },
    closeSubmit() {
      this.$emit('change-dialog', false)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
